package org.fh.hce06.impferinnerung.gui;


import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JButton;

import java.awt.Container;
import java.awt.Rectangle;
import javax.swing.JLabel;

public class MainFrame extends JFrame {



	/**
	 * This is the default constructor
	 */
	public MainFrame() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(300, 270);
		this.setContentPane(getJContentPane());
		this.setTitle("Impferinnerung");
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
	}

	private static final long serialVersionUID = 1L;
	public JPanel jContentPane = null;
	private JButton beenden = null;
	private JButton arztBtn = null;
	private JButton patientBtn = null;
	private JButton arztheferBtn = null;
	private JLabel siesindLabel = null;

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			
			//LABEL nicht modifizierbar
			siesindLabel = new JLabel();
			siesindLabel.setBounds(new Rectangle(23, 11, 100, 20));
			siesindLabel.setText("  Sie sind");
			siesindLabel.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
				public void propertyChange(java.beans.PropertyChangeEvent e) {
					if ((e.getPropertyName().equals("enabled"))) {
						System.out.println("propertyChange(enabled)"); // TODO Auto-generated property Event stub "enabled" 
					}
				}
			});
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(getBeendenBtn(), null);
			jContentPane.add(getArztBtn(), null);
			jContentPane.add(getPatientBtn(), null);
			jContentPane.add(getArztheferBtn(), null);
			jContentPane.add(siesindLabel, null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes beenden	
	 * 	
	 * @return javax.swing.JButton	
	 */
	//BUTTON generierung
	private JButton getBeendenBtn() {
		if (beenden == null) {
			beenden = new JButton();
			beenden.setText("Beenden");
			beenden.setBounds(new Rectangle(175, 175, 100, 30));
			beenden.addActionListener(new java.awt.event.ActionListener() {
				//Event Listener
				public void actionPerformed(java.awt.event.ActionEvent e) {
					System.out.println("actionPerformed()");
					
				}
			});
		}
		return beenden;
	}

	/**
	 * This method initializes arztBtn	
	 * 	
	 * @return javax.swing.JButton	
	 */
	//	BUTTON generierung
	private JButton getArztBtn() {
		if (arztBtn == null) {
			arztBtn = new JButton();
			arztBtn.setBounds(new Rectangle(30, 90, 130, 30));
			arztBtn.setText("Arzt");
			arztBtn.addActionListener(new java.awt.event.ActionListener() {
				//	Event Listener
				public void actionPerformed(java.awt.event.ActionEvent e) {
					System.out.println("actionPerformed()"); 
					
					
					jContentPane.setVisible(false);
					jContentPane.removeAll();
					ArztLoginPanel arztLoginPanel = new ArztLoginPanel();
					jContentPane.add(arztLoginPanel);
					arztLoginPanel.setVisible(true);
					jContentPane.setVisible(true);
					
					
				}
			});
		}
		return arztBtn;
	}
	
	/**
	 * This method initializes patientBtn	
	 * 	
	 * @return javax.swing.JButton	
	 */
//	BUTTON generierung
	private JButton getPatientBtn() {
		if (patientBtn == null) {
			patientBtn = new JButton();
			patientBtn.setBounds(new Rectangle(30, 45, 130, 30));
			patientBtn.setText("Patient");
			patientBtn.addActionListener(new java.awt.event.ActionListener() {
				//Event Listener
				public void actionPerformed(java.awt.event.ActionEvent e) {
					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
				
					jContentPane.setVisible(false);
					jContentPane.removeAll();
					PatientLoginPanel patientLoginPanel = new PatientLoginPanel();
					jContentPane.add(patientLoginPanel);
					patientLoginPanel.setVisible(true);
					jContentPane.setVisible(true);
				
				
				}
			});
		}
		return patientBtn;
	}

	/**
	 * This method initializes arztheferBtn	
	 * 	
	 * @return javax.swing.JButton	
	 */
	//	BUTTON generierung
	private JButton getArztheferBtn() {
		if (arztheferBtn == null) {
			arztheferBtn = new JButton();
			arztheferBtn.setBounds(new Rectangle(30, 135, 130, 30));
			arztheferBtn.setText("Arzthelfer");
			arztheferBtn.addActionListener(new java.awt.event.ActionListener() {
				//Event Listener
				public void actionPerformed(java.awt.event.ActionEvent e) {
					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
				
					jContentPane.setVisible(false);
					jContentPane.removeAll();
					ArztHelferLoginPanel arzthelferLoginPanel = new ArztHelferLoginPanel();
					jContentPane.add(arzthelferLoginPanel);
					arzthelferLoginPanel.setVisible(true);
					jContentPane.setVisible(true);
				
				
				}
				
			});
		}
		return arztheferBtn;
	}

}  //  @jve:decl-index=0:visual-constraint="46,19"
